#pragma once

#include "singleton.hpp"
#include "AMobileDeviceInterface.h"

class AMobileDevice
{
public:
	AMobileDevice();
	virtual ~AMobileDevice();
	virtual void OnConnected(am_device* lpDevice) = 0;
	virtual void OnDisconnected(am_device* lpDevice) = 0;
};

class AMobileDeviceListenerImpl
{
public:
	AMobileDeviceListenerImpl(void);
	~AMobileDeviceListenerImpl(void);

	void Register(AMobileDevice* lpDevice);

	void Listen();
	void Close();

	static void AMDeviceNotificationCallback(am_device_notification_callback_info * callback);

private:
	vector<AMobileDevice*>		lpDeviceList;
	am_device_notification*		lpAMDeviceNotification;
};

typedef Singleton<AMobileDeviceListenerImpl> AMobileDeviceListener;
